// TestCaseGeneratorUI
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TestCaseModel;

namespace TestCaseGenerator
{
    public partial class Scratch1 : Form
    {
        TestModel model = new TestModel();

        public Scratch1()
        {
            InitializeComponent();
        }

        private void Scratch1_Load(object sender, EventArgs e)
        {
            model = TestModel.CreateFromXml(@"e:\temp\LoginDialog.TestModel");


            parameterClassesControl1.TestParameters = model.TestParameters;
            resultRuleExpressionUI1.Model = model;

            resultsEditorControl1.Results = model.TestResults;
        }

        private void parameterClassesControl1_Load(object sender, EventArgs e)
        {
            //
        }

        private void parameterClassesControl1_NodeChanged(TreeNode currentNode, Parameter currentParameter, EquivClass currentClass)
        {
            if (currentClass != null)
            {
                string s = currentParameter.Name + "; " + currentClass.Id;
                listBox1.Items.Add(s);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            model.SaveAsXml("e:\\temp\\a.xml");
            string[] x = System.IO.File.ReadAllLines("e:\\temp\\a.xml");
            listBox2.Items.Clear();
            foreach (string s in x)
                listBox2.Items.Add(s);
        }
    }
}